<template>
  <view class="result-page">
    <!-- 顶部导航栏 -->
    <view class="nav-bar">
      <uni-icons type="back" size="24" @click="goBack" />
      <text class="title">正鳳學習中心AI测评</text>
      <uni-icons type="more-filled" size="24" />
    </view>

    <!-- 恭喜完成测试 -->
    <view class="congrats">
      <!-- <image class="icon" src="@/static/image/common/celebrate.png" /> -->
      <text class="congrats-text">恭喜完成测试！</text>
    </view>

    <!-- 用户信息 -->
    <view class="user-info">
      <!-- <image class="avatar" src="https://via.placeholder.com/60" /> -->
      <text class="phone">138****8888</text>
    </view>

    <!-- 成绩及报告 -->
    <view class="report-card">
      <view class="score">
        <text class="score-num">38</text>
        <text class="score-unit">分</text>
      </view>
      <view class="report-detail">
        <view class="detail-item">
          <view class="dot blue" />
          <text>测试用时 7分3秒</text>
        </view>
        <view class="detail-item">
          <view class="dot blue" />
          <text>已经超过 9%的人</text>
        </view>
      </view>
    </view>

    <!-- 雷达图 -->
    <view class="radar-chart">
      <!-- 这里可以用第三方组件或canvas实现雷达图，先用占位图 -->
      <!-- <image src="@/static/image/common/radar-placeholder.png" mode="widthFix" /> -->
      <view class="radar-label vocab">
        词汇
      </view>
      <view class="radar-label grammar">
        语法
      </view>
      <view class="radar-label listen">
        听力
      </view>
      <view class="radar-label read">
        阅读
      </view>
    </view>

    <!-- 按钮区 -->
    <view class="btn-group">
      <button class="btn retry">
        再测一次
      </button>
      <button class="btn detail">
        错题详情
      </button>
    </view>
    <view class="deep-analysis">
      <button class="btn analysis">
        获取深度分析 →
      </button>
    </view>

    <!-- 底部tab栏 -->
    <view class="tab-bar">
      <view class="tab-item">
        <uni-icons type="compose" size="24" />
        <text>测评</text>
      </view>
      <view class="tab-item">
        <uni-icons type="person" size="24" />
        <text>我的</text>
      </view>
    </view>
  </view>
</template>

<script lang="ts" setup>
const goBack = () => {
  uni.navigateBack();
};
</script>

<style scoped>
.result-page {
  background: linear-gradient(180deg, #e6f0ff 0%, #fff 40%);
  min-height: 100vh;
  padding-bottom: 80rpx;
}
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32rpx 24rpx 0 24rpx;
}
.title {
  font-size: 32rpx;
  font-weight: bold;
}
.congrats {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 32rpx;
}
.icon {
  width: 60rpx;
  height: 60rpx;
}
.congrats-text {
  font-size: 36rpx;
  font-weight: bold;
  margin-top: 12rpx;
}
.user-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24rpx;
}
.avatar {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  border: 4rpx solid #fff;
  box-shadow: 0 2rpx 8rpx #eee;
}
.phone {
  margin-top: 8rpx;
  color: #888;
  font-size: 28rpx;
}
.report-card {
  background: #fff;
  border-radius: 24rpx;
  margin: 32rpx 24rpx 0 24rpx;
  padding: 32rpx 0;
  box-shadow: 0 2rpx 12rpx #f0f4fa;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.score {
  display: flex;
  align-items: baseline;
}
.score-num {
  font-size: 64rpx;
  font-weight: bold;
  color: #222;
}
.score-unit {
  font-size: 28rpx;
  margin-left: 8rpx;
  color: #888;
}
.report-detail {
  margin-top: 16rpx;
}
.detail-item {
  display: flex;
  align-items: center;
  margin-top: 8rpx;
}
.dot {
  width: 12rpx;
  height: 12rpx;
  border-radius: 50%;
  margin-right: 8rpx;
}
.blue {
  background: #3a7afe;
}
.radar-chart {
  margin: 32rpx auto 0 auto;
  width: 320rpx;
  height: 320rpx;
  position: relative;
}
.radar-label {
  position: absolute;
  font-size: 24rpx;
  color: #666;
}
.vocab { left: 50%; top: 0; transform: translateX(-50%);}
.grammar { right: 0; top: 50%; transform: translateY(-50%);}
.listen { left: 50%; bottom: 0; transform: translateX(-50%);}
.read { left: 0; top: 50%; transform: translateY(-50%);}
.btn-group {
  display: flex;
  justify-content: center;
  margin: 32rpx 0 0 0;
}
.btn {
  width: 220rpx;
  height: 64rpx;
  border-radius: 32rpx;
  font-size: 28rpx;
  margin: 0 16rpx;
}
.retry {
  background: #f5f5f5;
  color: #222;
}
.detail {
  background: #3a7afe;
  color: #fff;
}
.deep-analysis {
  margin: 32rpx 24rpx 0 24rpx;
}
.analysis {
  width: 100%;
  background: #e6f0ff;
  color: #3a7afe;
  border: none;
  font-size: 28rpx;
  border-radius: 32rpx;
}
.tab-bar {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 100rpx;
  background: #fff;
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2rpx 8rpx #eee;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #888;
  font-size: 24rpx;
}
</style>
